import { $http } from './index';

export interface topTagModel {
    id: number;
    pid: number;
    name: string;
    cityLevel?: number;
    wordPack?: number;
    children?: topTagModel[];
}

// 获取父标签
export function getJcTopTags() {
    return $http.get('/tag/jc/topTags');
}

// 获取子标签
export function getJcChildTags(id: number): Promise<topTagModel[]> {
    return $http.get(`/tag/jc/childTags?tid=${id}`);
}

// 创建标签任务洞察包
export function getJdQueryData(params: object) {
    return $http.post('/tag/jc/create', params);
}

// 目标对齐保存策略
export function saveJdStrategy(params: object) {
    return $http.post('/tag/td/alignTarget', params);
}

// 检查tag是否至少含有一个除了城市以外的标签
export function checkTagData(params: object) {
    return $http.post('/tag/jc/tag/check', params);
}
